<template>
  <div class="win">
    <img class="banner" v-if="topBanner[0]" :src="topBanner[0].src" mode="widthFix" />
    <div class="bottom_box">
      <img v-if="bjurl" @click="hr_courseList(1)" :src="bjurl+'house_use.png'" mode="widthFix" />
      <img v-if="bjurl" @click="hr_courseList(2)" :src="bjurl+'house_sale.png'" mode="widthFix" />
      <img v-if="bjurl" @click="hr_courseList(3)" :src="bjurl+'house_science.png'" mode="widthFix" />
    </div>
    <i-toast id="toast" />
  </div>
</template>

<script>
export default {
  data() {
    return {
      bjurl: "",
      topBanner: [],
      type: 0,
    };
  },
  methods: {
    // 请求接口课程banner
    getHouseBanner() {
      this.$ajax("/home/home/banner", "post", {
        mark: "socardCourse"
      })
        .then(res => {
          
          if (res.status) {
            this.topBanner = res.data;
          } else {
          }
        })
        .catch(err => {
        });
    },
    hr_courseList(type) {
      wx.navigateTo({
        url: "../courseList/main?type=" + type
      });
    }
  },
  onLoad(e) {
    Object.assign(this.$data, this.$options.data());
    this.getHouseBanner();
    this.bjurl = this.$bjurl;
  }
};
</script>

<style lang="scss" scoped>
.win {
  .banner {
    width: 750rpx;
  }
  .bottom_box {
    padding: 40rpx 0 20rpx 0;
    img {
      margin: 0 auto 20rpx;
      width: 690rpx;
    }
  }
}
</style>
